package com.gwm.item.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import com.gwm.item.pojo.TbCategory;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 商品类目表，类目和商品(spu)是一对多关系，类目与品牌是多对多关系 Mapper 接口
 * </p>
 *
 * @author heima
 * @since 2020-12-01
 */
public interface TbCategoryMapper extends BaseMapper<TbCategory> {

    @Select("select c.* from tb_category c, tb_category_brand cb  where cb.brand_id=#{brandId} and cb.category_id=c.id")
    List<TbCategory> findCategoryListByBrandId(Long brandId);
}
